/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package centralehotel.modele;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Mathieu
 */
@Entity
@Table(name = "gestionnaire_hotel")
@NamedQueries({@NamedQuery(name = "GestionnaireHotel.findByIdGestionnaireHotel", query = "SELECT g FROM GestionnaireHotel g WHERE g.idGestionnaireHotel = :idGestionnaireHotel"), @NamedQuery(name = "GestionnaireHotel.findByQualite", query = "SELECT g FROM GestionnaireHotel g WHERE g.qualite = :qualite"), @NamedQuery(name = "GestionnaireHotel.findByNom", query = "SELECT g FROM GestionnaireHotel g WHERE g.nom = :nom"), @NamedQuery(name = "GestionnaireHotel.findByPrenom", query = "SELECT g FROM GestionnaireHotel g WHERE g.prenom = :prenom"), @NamedQuery(name = "GestionnaireHotel.findBySociete", query = "SELECT g FROM GestionnaireHotel g WHERE g.societe = :societe"), @NamedQuery(name = "GestionnaireHotel.findByAdresse", query = "SELECT g FROM GestionnaireHotel g WHERE g.adresse = :adresse"), @NamedQuery(name = "GestionnaireHotel.findByCodePostale", query = "SELECT g FROM GestionnaireHotel g WHERE g.codePostale = :codePostale"), @NamedQuery(name = "GestionnaireHotel.findByVille", query = "SELECT g FROM GestionnaireHotel g WHERE g.ville = :ville"), @NamedQuery(name = "GestionnaireHotel.findByEmail", query = "SELECT g FROM GestionnaireHotel g WHERE g.email = :email"), @NamedQuery(name = "GestionnaireHotel.findByPassword", query = "SELECT g FROM GestionnaireHotel g WHERE g.password = :password")})
@NamedQuery(name="GestionnaireHotel.checkLogin",query="SELECT g FROM GestionnaireHotel g WHERE g.email = :email AND g.password = :password")
public class GestionnaireHotel implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "id_gestionnaire_hotel", nullable = false)
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    private Integer idGestionnaireHotel;
    @Column(name = "qualite")
    private String qualite;
    @Column(name = "nom")
    private String nom;
    @Column(name = "prenom")
    private String prenom;
    @Column(name = "societe")
    private String societe;
    @Column(name = "adresse")
    private String adresse;
    @Column(name = "code_postale")
    private String codePostale;
    @Column(name = "ville")
    private String ville;
    @Column(name = "email")
    private String email;
    @Column(name = "password")
    private String password;
    @OneToMany(mappedBy = "gestionnaireHotel")
    private Collection<FicheHotel> ficheHotelCollection;

    public GestionnaireHotel() {
    }

    public GestionnaireHotel(Integer idGestionnaireHotel) {
        this.idGestionnaireHotel = idGestionnaireHotel;
    }

    public Integer getIdGestionnaireHotel() {
        return idGestionnaireHotel;
    }

    public void setIdGestionnaireHotel(Integer idGestionnaireHotel) {
        this.idGestionnaireHotel = idGestionnaireHotel;
    }

    public String getQualite() {
        return qualite;
    }

    public void setQualite(String qualite) {
        this.qualite = qualite;
    }

    public String getNom() {
        return nom;
    }

    public void setNom(String nom) {
        this.nom = nom;
    }

    public String getPrenom() {
        return prenom;
    }

    public void setPrenom(String prenom) {
        this.prenom = prenom;
    }

    public String getSociete() {
        return societe;
    }

    public void setSociete(String societe) {
        this.societe = societe;
    }

    public String getAdresse() {
        return adresse;
    }

    public void setAdresse(String adresse) {
        this.adresse = adresse;
    }

    public String getCodePostale() {
        return codePostale;
    }

    public void setCodePostale(String codePostale) {
        this.codePostale = codePostale;
    }

    public String getVille() {
        return ville;
    }

    public void setVille(String ville) {
        this.ville = ville;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Collection<FicheHotel> getFicheHotelCollection() {
        return ficheHotelCollection;
    }

    public void setFicheHotelCollection(Collection<FicheHotel> ficheHotelCollection) {
        this.ficheHotelCollection = ficheHotelCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idGestionnaireHotel != null ? idGestionnaireHotel.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof GestionnaireHotel)) {
            return false;
        }
        GestionnaireHotel other = (GestionnaireHotel) object;
        if ((this.idGestionnaireHotel == null && other.idGestionnaireHotel != null) || (this.idGestionnaireHotel != null && !this.idGestionnaireHotel.equals(other.idGestionnaireHotel))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "centralehotel.exception.GestionnaireHotel[idGestionnaireHotel=" + idGestionnaireHotel + "]";
    }

}
